package com.springboot.controller;

import com.springboot.config.log.SpringBootRequestLog;
import com.springboot.jwt.interfaces.JwtToken;
import com.springboot.service.wangyi.WangYiService;
import com.springboot.util.enums.RespErrorCode;
import com.springboot.util.http.ResponseBuilder;
import com.springboot.util.http.ResultResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName wangyi
 * @Description
 * @Author zyj
 * @Date 2022/7/7 14:44
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/wangYi")
@SpringBootRequestLog
@Tag(name = "网易")
public class WangYiController {

    @Autowired
    private WangYiService wangYiService;

    @JwtToken
    @PostMapping("/yunMusic")
    @Operation(description = "用户名密码登录")
    public ResultResponse<Object> yunMusic() {
        try {
            wangYiService.yunMusic();
            return ResponseBuilder.success();
        } catch (Exception e) {
            return ResponseBuilder.errorMessage(RespErrorCode.USER_NULL.getValue(), RespErrorCode.USER_NULL.getDescripe());
        }
    }
}
